﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Manage.Master" AutoEventWireup="true" CodeBehind="ViewCategory.aspx.cs" Inherits="OnlineAuction.Admin.ViewCategory" %>

<%@ Register Assembly="CollectionPager" Namespace="SiteUtils" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cph_Css" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cph_TopBar" runat="server">
    <div id="dv_TopBar">
        <a href="AddCategory.aspx">ADD NEW</a>
        <span style="color: red">|</span>
        <a href="MergeCategory.aspx">Merge Category</a>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cph_Content" runat="server">
    <table cellpadding="5" cellspacing="5" class="style1">
        <caption style="font-size: larger; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #FF6600">Items Selling</caption>
        <tr>
            <td style="text-align: center">
                <asp:GridView ID="grvCategory" runat="server" AutoGenerateColumns="false" Width="679px"
                    OnRowCommand="grvCategory_RowCommand" OnPageIndexChanging="grvCategory_PageIndexChanging">
                    <Columns>
                        <asp:TemplateField HeaderText="Category Name">
                            <ItemTemplate>
                                <asp:Label ID="lbCategoryName" runat="server" Text='<%# Bind("CategoryName") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Category Logo">
                            <ItemTemplate>
                                <asp:Label ID="lbCategoryLogo" runat="server" Text='<%# Bind("CategoryLogo") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Category State">
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# State((Boolean)Eval("CategoryState")) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Edit">
                            <ItemTemplate>
                                <a href='EditCategory.aspx?CategoryID=<%#Eval("CategoryID") %>'>Edit</a>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Delete" ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
                                    CommandName="Delete" Text="Delete" CommandArgument='<%# Eval("CategoryID") %>'
                                    OnClientClick="if (!window.confirm('Are you sure you want to delete this category?\nWanning : Data can be lost?')) return false;"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <asp:Label ID="lbEmpty" runat="server" Text="Can't find any categorys" />
                    </EmptyDataTemplate>
                </asp:GridView>
                <cc1:CollectionPager ID="cpCategorySelling" runat="server" SectionPadding="10" SliderSize="5">
                </cc1:CollectionPager>
            </td>
        </tr>
        <tr>
            <td style="height: 30px; text-align: center" />
        </tr>
    </table>
</asp:Content>
